var UserTutorop = app.controller('UserTutorop', function($http, $scope, $rootScope, $location,$cordovaDevice,$cordovaChat,UserTutoropData) {
	try{
		$rootScope.showf=false;
		$scope.o='';
		$scope.p='';
		$scope.show = false;
		$scope.busy = false;
		if($rootScope.btrs1_organization!=undefined&&$rootScope.btrs1_organization!=""&&$rootScope.btrs1_organization!=null){
			$scope.o=$rootScope.btrs1_organization;
		};
		if($rootScope.btrs1_position!=undefined&&$rootScope.btrs1_position!=""&&$rootScope.btrs1_position!=null){
			$scope.p=$rootScope.btrs1_position;
		};
		
		$scope.keyPress=function(e){
			if(e.which==13){
				$scope.save();
			}
		}
		$scope.keyPressNext=function(e){
			if(e.which==13||e.which==9){
				$scope.save();
			}
		}
		//保存信息
		$scope.save=function(){
			if($scope.o == ""){
				showtoast("请输入任职机构");
				return false;
			}
			if($scope.p ==""){
				showtoast("请输入职务");
				return false;
			}
			$rootScope.btrs1_organization=$scope.o;
			$rootScope.btrs1_position=$scope.p;
			$rootScope.back();
		}
	}
	catch (e) {
		showcatch(e);
	}
});
UserTutorop.UserTutoropData=function($q, $http,$stateParams,$rootScope){
	try {
		var data = [];
		var def = $q.defer();
		if(window.localStorage.u==undefined||window.localStorage.u==null||window.localStorage.u==""){			
			$rootScope.go("loginmain");
		}else{
			def.resolve(data);
		}
		
		return def.promise;
	} catch (e) {
		showcatch(e);
	}
}